package com.itheima.subway.info.manage.domain;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

public class ManagerMassage {
    //用来将managers.txt中的数据读取到list集合中
    public static ArrayList<Managers> readManagers() throws IOException {
        ArrayList<Managers> list = new ArrayList<>();

        BufferedReader br = new BufferedReader(new FileReader("study_test01\\managers.txt"));
        String line;
        while ((line = br.readLine()) != null) {
            String[] split = line.split(",");
            Managers m = new Managers(split[0], split[1], split[2], split[3]);
            list.add(m);
        }
        br.close();
        return list;
    }
}
